use std::process::Command;
use std::thread;
fn main() {
    limited_command().unwrap();
}
// 资源限制
fn limited_command() -> Result<(), Box<dyn std::error::Error>> {
    let handle = thread::spawn(move || {
        Command::new("some_long_running_process")
            // .args(["-l", "-h"])
            .output()
    });
    match handle.join().unwrap() {
        Ok(output) => {
            println!("Output: {}", String::from_utf8_lossy(&output.stdout));
            Ok(())
        }
        Err(e) => Err(Box::new(e)),
    }
}